class <%= migration_name %> < ActiveRecord::Migration
  def self.up
    create_table "<%= table_name %>", :force => true do |t|
      t.column :first_name,                 :string, :limit => 20,  :null => false
      t.column :last_name,                  :string, :limit => 20,  :null => false
      t.column :middle_name,                :string, :limit => 20,  :null => true
      t.column :login,                      :string, :limit => 40,  :null => false
      t.column :email,                      :string, :limit => 100, :null => false
      t.column :crypted_password,           :string, :limit => 40,  :null => false
      t.column :salt,                       :string, :limit => 40,  :null => false
      t.column :created_at,                 :datetime,              :null => false
      t.column :updated_at,                 :datetime,              :null => false
      t.column :remember_token,             :string,                :null => true
      t.column :remember_token_expires_at,  :datetime,              :null => false      
# To support User Activation
      t.column :activation_code,            :string, :limit => 40,  :null => true
      t.column :activated_at,               :datetime,              :null => true
# To support Password Resetting
      t.column :password_reset_code,        :string, :limit => 40,  :null => true
# To allow users to belong to a type for instance Admin, User, Moderator, etc.
      t.column :type,                       :string, :limit => 20,  :null => false, :default => "<%= table_name.singularize %>"
    end
  end

  def self.down
    drop_table "<%= table_name %>"
  end
end
